-- GENERATED SPELL FOR [Foreman Thaldrin] --


function spell0_31399(pUnit, Event) --@Cleave,n/a--
pUnit:FullCastSpellOnTarget(59992,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_31399', 603, 1)
end

function spell1_31399(pUnit, Event) --@Frost Shock,n/a--
pUnit:FullCastSpellOnTarget(21401,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_31399', 8259, 1)
end

function spell2_31399(pUnit, Event) --@Rend,n/a--
pUnit:FullCastSpellOnTarget(16509,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_31399', 15000, 1)
end

function spell3_31399(pUnit, Event) --@Strike,n/a--
pUnit:FullCastSpellOnTarget(15580,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_31399', 640, 1)
end

function Sorts_31399(pUnit, Event)
local choix_sorts_31399 = math.random(0, 3)
if choix_sorts_31399 == 0 then
pUnit:RegisterEvent('spell0_31399', 1, 1)
end
if choix_sorts_31399 == 1 then
pUnit:RegisterEvent('spell1_31399', 1, 1)
end
if choix_sorts_31399 == 2 then
pUnit:RegisterEvent('spell2_31399', 1, 1)
end
if choix_sorts_31399 == 3 then
pUnit:RegisterEvent('spell3_31399', 1, 1)
end
end

function mob31399_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_31399', math.random(1500, 3000), 1)
end

function mob31399_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob31399_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob31399_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(31399, 1, 'mob31399_Action')
RegisterUnitEvent(31399, 2, 'mob31399_Leave')
RegisterUnitEvent(31399, 3, 'mob31399_Kill')
RegisterUnitEvent(31399, 4, 'mob31399_Die')
